//
//  CordovaWebController.m
//  CordovaDemo
//
//  Created by menchao on 2018/10/24.
//  Copyright © 2018年 cedarhd. All rights reserved.
//

#import "CordovaWebController.h"
#import <WebKit/WebKit.h>

#define PATH_UPDATE_WWW             [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/www/"]



@interface CordovaWebController ()

@end


//ile:///Users/menchao/Library/Developer/CoreSimulator/Devices/EF30FB3E-93E5-4B40-AE03-8FB37A880708/data/Containers/Data/Application/96BDB7DD-99A5-488C-B245-D8E4AE72657E/Documents/www
@implementation CordovaWebController

- (void)setLocalStorageStartPage:(NSString *)startPage{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"www"];
    NSString *tempStartPage = [NSString stringWithFormat:@"/%@",startPage];
    NSString *loadUrl = [path stringByAppendingPathComponent:tempStartPage];
    NSURL *urldefault = [NSURL fileURLWithPath:loadUrl];
    self.wwwFolderName = @"www";
    self.startPage = urldefault.absoluteString;
    NSLog(@"wwwFolderName :%@",self.wwwFolderName);
    NSLog(@"startPage : %@",self.startPage);
}

- (void)viewDidLoad {
   // [self setLocalStorageStartPage:@"index.html"];
    [super viewDidLoad];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
